package com.hkyp.ss.course.provider.repository;

import com.hkyp.ss.course.provider.model.CourseComment;
import com.hkyp.ss.course.provider.repository.baseRepository.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CourCommRepository extends BaseRepository<CourseComment,Long> {

    //未使用
//    @Query(value = "select cc from CourseComment cc where cc.status = 0 and cc.courseId = (:courseId) order by cc.createAt desc ")
//    List findCourseCommentsByStatusAndCourseIdOrderByCreateAtDesc(Integer status, Long courseId);

    List<CourseComment> findAllByCourseIdInAndUserIdEqualsAndDeletedEquals(Iterable<Long> cids, Long userId, Integer deleted);


    List<CourseComment> findByCourseIdAndUserIdAndDeletedAndStatus(Long cid, Long userId, Integer deleted,Integer status);


}
